package com.zhuhjay.app.web.controller.imchat;

import com.zhuhjay.common.base.controller.BaseController;
import com.zhuhjay.common.web.model.domain.CursorReq;
import com.zhuhjay.common.web.model.domain.CursorResp;
import com.zhuhjay.service.imchat.model.vo.ChatMessageVo;
import com.zhuhjay.service.imchat.service.ChatMessageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author ZhuHJay
 * @since 2023-07-11
 */
@Api(tags = "聊天消息")
@Validated
@RestController
@RequestMapping("/chat/message")
public class ChatMessageController extends BaseController {

    @Resource
    private ChatMessageService messageService;

    @ApiOperation("获取聊天消息列表")
    @GetMapping("list")
    public CursorResp<ChatMessageVo> cursor(@Valid CursorReq cursorReq) {
        return messageService.cursor(cursorReq);
    }

}
